﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Clients_SpravaUctu : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            sourcePerson.SelectParameters["email"].DefaultValue = Context.User.Identity.Name;
            sourceAccount.SelectParameters["Id"].DefaultValue = DatabaseManager.getPerson(Context.User.Identity.Name).Account;
            //viewAccount.Fields["lastLogin"].DefaultValue = Membership.GetUser(Context.User.Identity.Name).LastLoginDate.ToString();
     
            //Membership.GetUser(Context.User.Identity.Name).LastLoginDate.ToString()
            Page.DataBind();
        }
    }

    protected void cmd_DeleteAccount_Click(object sender, EventArgs e)
    {
         PersonManager.deleteUser(Context.User.Identity.Name);
         Context.User = null;

        // odhlašeni uživatele
         Response.Redirect("..allusers/home.aspx");
    }
}
